<app-back-btn></app-back-btn>
<div class="page-title">
  <span class="title" *ngIf="!this.code">添加管理员账户</span>
  <span class="title" *ngIf="this.code">修改管理员账户</span>
</div>

<div class="panel panel-body">
  <form nz-form [formGroup]="validateForm" class="form-wrap" (submit)="addPlatformAccount($event)">
    <h2 class="subtitle">账户信息</h2>

    <!--account start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="account" nzRequired> 账户</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('account')">
        <input nz-input formControlName="account" type="text" id="account" placeholder="账户">
        <nz-form-explain *ngIf="getFormControl('account').dirty&&getFormControl('account').errors">
          <ng-container *ngIf="getFormControl('account').hasError('required')">请输入账户</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        账户
      </nz-form-control>
    </nz-form-item>

    <!--password start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="password" nzRequired> 密码</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('password')">
        <input nz-input formControlName="password" type="password" id="password" placeholder="密码">
        <nz-form-explain *ngIf="getFormControl('password').dirty&&getFormControl('password').errors">
          <ng-container *ngIf="getFormControl('password').hasError('required')">请输入密码</ng-container>
        </nz-form-explain>
      </nz-form-control>
      <nz-form-control [nzSm]="7" class="font12 pl color-gray">
        密码
      </nz-form-control>
    </nz-form-item>

    <!--isSuper start-->
    <nz-form-item>
      <nz-form-label [nzSm]="7" nzFor="isSuper" nzRequired>是否是超级账户</nz-form-label>
      <nz-form-control [nzSm]="10" [nzValidateStatus]="getFormControl('isSuper')">
        <nz-switch formControlName="isSuper" nzCheckedChildren="是" nzUnCheckedChildren="否"></nz-switch>
      </nz-form-control>
    </nz-form-item>

    <!--表单底部start-->
    <nz-form-item class="action-button">
      <nz-form-control class="text-center">
        <button nz-button nzSize="large" [nzType]="'primary'" type="submit" class="pl-30 pr-30" [nzLoading]="isConfirmLoading">
          确定
        </button>
      </nz-form-control>
    </nz-form-item>
    <!--表单底部end-->
  </form>

</div>
